/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session02;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author macbookpro
 */
public class Join_isAlive_Thread_Test {
    public static void main(String[] args) {
        System.out.println("START MAIN THREAD");
        
        Join_isAlive_Thread t = new Join_isAlive_Thread();
        t.start();
        
        if(t.isAlive()){
            try {
                //Dung Main Thread cho den khi t Thread chay xong
                t.join();
            } catch (InterruptedException ex) {
                System.out.println("ERROR.");
            }
        }
        
        //while(t.isAlive()); //Tuong tu nhu join()
        
        System.out.println("STOP MAIN THREAD");
    }
    
}
